﻿using IMServer.Models.Message;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;

namespace IMServer.Models;

public class MessageBox
{
    [BsonId]
    public ObjectId Id { get; set; }

    [BsonElement("userId")]
    public string UserId { get; set; } = null!;
    
    [BsonElement("messages")]
    public List<BaseMessage> Messages { get; set; } = new List<BaseMessage>();

    [BsonElement("lastReadTime")]
    public DateTime LastReadTime { get; set; } = DateTime.UtcNow;

    [BsonElement("unreadCount")]
    public int UnreadCount { get; set; } = 0;
}